<?php

abstract class UndeadStudents_Db_Table_Abstract extends Zend_Db_Table_Abstract {

    public function insert(array $data) {
        
        if (empty($data['created_at'])) {
            
            $dt = new Zend_Date();
            $dt = $dt->toString("yyyy-MM-dd HH:mm:s");
            
            $data['created_at'] = $dt;
        }        
        
        return parent::insert($data);
    }
    
    public function update(array $data, $where) {
        
        if (empty($data['updated_at'])) {
            
            $dt = new Zend_Date();
            $dt = $dt->toString("yyyy-MM-dd HH:mm:s");
            
            $data['updated_at'] = $dt;
        }
        
        return parent::update($data, $where);
    }
    
}